#ifndef YCBASECOPY_FILES_TASK_H
#define YCBASECOPY_FILES_TASK_H
#include "base/task/task.h"

namespace yc {

class CopyFile;
class CopyFilesTask : public Task
{
    Q_OBJECT

public:
    CopyFilesTask(const QList<QString>& file_names, const QString& target_dir, int id = 0,
                  QObject* parent = nullptr);
    CopyFilesTask(const QString& source_dir, const QString& exclude_suffixes,
                  const QString& target_dir, int id = 0, QObject* parent = nullptr);

    qint64 evaluateTotalMSecs() const override;

Q_SIGNALS:
    void copyFinished(const QString& file_name, const QString& new_file_name);

private:
    void startImpl() override;
    void onCopyFinished(const QString& file_name, const QString& new_file_name);
    void startNext();

    QList<QString> file_names_;
    QString target_dir_;
    CopyFile* copy_file_;
    int pos_;
};
} // namespace yc

#endif // YCBASECOPY_FILES_TASK_H
